﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.IO;
using Frame.Lib.Core.Base;
using Cms.Entity.FreindLink;
using Cms.DAL.FreindLink;

namespace Cms.BLL.FreindLink
{
    public class FreindLinkBO : CommonOperate<FreindLinkInfo>
    {
        private FreindLinkDAL _freindLink;
        protected override BaseDAL DAL
        {
            get
            {
                return _freindLink;
            }
        }
        public FreindLinkBO()
        {
            _freindLink = new FreindLinkDAL();
        }

        public void DeleteImage(int id)
        {           
            FreindLinkInfo info = this.GetInfo(id);
            if (!string.IsNullOrEmpty(info.ImagePath))
            {
                string phyPath = System.Web.HttpContext.Current.Server.MapPath(info.ImageAbsPath);
                if (File.Exists(phyPath))
                {
                    File.Delete(phyPath);
                }
            }
        }
    }
}
